<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
    <style>
        .color{
            color: red;
        }
    </style>
  </head>
  <body>
    <div>
      <table>
        <tr>
          <td>
            <input type="button" value="点击就送屠龙宝刀1" />
          </td>
        </tr>
        <tr>
          <td>
            <input type="button" value="点击就送屠龙宝刀2" />
          </td>
        </tr>
        <tr>
          <td>
            <input type="button" value="点击就送屠龙宝刀3" />
          </td>
        </tr>
      </table>
    </div>
    <script>
      let node = document.querySelectorAll("div table tr td input");
      node.forEach(function(item,i){
          console.log(item)
          item.onclick = function(){
              if(item.value=="点击就送屠龙宝刀1"){
                  this.value = "已经送了"
                  this.setAttribute("class","color")
              }
              if(item.value == "点击就送屠龙宝刀2"){
                  this.parentElement.parentElement.remove()
              }
          }
      })
    </script>
  </body>
</html>
